#include<bits/stdc++.h>
using namespace std;
void bag_wanquan(){
    vector<int> weight={1,3,4};
    vector<int> value={15,20,30};
    int bagWeight=4;
    vector<int> dp(bagWeight+1,0);

    for(int i=0;i<weight.size();i++){//遍历物品
        for(int j=weight[i];j<=bagWeight;j++){//遍历背包
            dp[j]=max(dp[j],dp[j-weight[i]]+value[i]);
        }
    }
    cout<<dp[bagWeight]<<endl;
}